{template 'common/header'}

<ul class="nav nav-tabs">
	<li class="active"><a>会员信息列表</a></li>
</ul>
	<div class="panel panel-default">
		<div class="panel-heading">会员列表</div>
		<div class="panel-body">
			<div class="table-responsive panel-body">
				<table class="table table-hover" style="min-width: 300px;">
					<thead class="navbar-inner">
						<tr>
							
							<th style="width:120px;">用户昵称</th>
							<th style="width:120px;">真实姓名</th>
							<th style="width:120px;">会员余额</th>
							<th style="width:120px;">电话</th>
							<th style="width:200px;">地址</th>
							<th style="width:300px;" class="text-right">操作</th>
						</tr>
					</thead>
						{loop $members $memberid $member}
						<tr>
							<form id="form{$member['id']}" action="javascript:;" method="post">
							<td>{$member['nickname']}</td>
							<td>{$member['realname']}</td>
							<td>{$member['balance']}元</td>
							<td>{$member['mobile']}</td>
							<td>{$member['address']}</td>
							
							<td class="text-right">
								<input type="text" name="chargenum" id="chargenum" class="span1" size='5' value="" />
								<input type="hidden" name="id" id="id" value="{$member['id']}" >
		                        <input type="hidden" name="uid" value="{$_GPC['uid']}" />
								<input type="hidden" name="token" value="{$_W['token']}" />
								<input name="submit" type="submit" onclick="chongzhi({$member['id']});" value="充 值" class="btn btn-primary span2">

								<a href="{php echo $this->createWebUrl('member',array('op'=>'delete','id'=>$member['id']));}" onclick="return confirm('此操作不可恢复，确认删除？');return false;" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-times"></i></a>
							</td>
							</form>

						</tr>
						{/loop}
						{if empty($members)}
						<tr>
							<td colspan="8">
								没有会员信息
							</td>
						</tr>
						{/if}
					</tbody>
				</table>
				{$pager}
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	function chongzhi(mid){
		
		var form_input = document.getElementById("form"+mid);
		var id = form_input['id'].value;
		var chargenum = form_input['chargenum'].value;

		$.post('{php echo $this->createWebUrl('member',array('op'=>'post'))}',{id:id,chargenum:chargenum},function(m){
        	alert(m);
        	window.location.href="{php echo $this->createWebUrl('member')}";
        	},"html");
	}

</script>>
{template 'common/footer'}